Greetings everyone!
I am trying to conduct an event study using stata and I am using the command eventstudy2 (Thomas Kaspereit ) . I am currently stuck on an error and unable to fix it.
The error is as follows :
"variables date __000005 do not uniquely identify observations in the using data" . I have tried to remove duplicates and yet it does not work
My full sample is 255 companies and 65,059 observations.
I am happy to provide my sample data if someone needs it.
Look forward to the stata community base here to help me.
Thanks very much!
Code error
My Code : eventstudy2 security_id date using security_returns_file, returns(security_returns) model(FM) marketfile(security_returns_file) marketreturns(market_return) replace
Generating dateline ...
...succeeded
Preparation of event list ...
...succeeded
Preparation of security return data...
variables date __000005 do not uniquely identify observations in the using data
r(459);
I am trying to conduct an event study using stata and I am using the command eventstudy2 (Thomas Kaspereit ) . I am currently stuck on an error and unable to fix it.
The error is as follows :
"variables date __000005 do not uniquely identify observations in the using data" . I have tried to remove duplicates and yet it does not work
My full sample is 255 companies and 65,059 observations.
I am happy to provide my sample data if someone needs it.
Look forward to the stata community base here to help me.
Thanks very much!
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str43 security_id int date double(security_return market_returns) byte market_id "NESTLE 'N'" 20030 -.0071276139242321 -.0097911745876343 1 "NESTLE 'N'" 20031 0 -.003852391383751 1 "NESTLE 'N'" 20032 .0085470605784583 .0142532617362586 1 "NESTLE 'N'" 20033 .0021253993123135 .0023391823531722 1 "NESTLE 'N'" 20034 -.0049663103139173 -.0053119893243944 1 "NESTLE 'N'" 20037 .0028409110016039 .0057236881178414 1 "NESTLE 'N'" 20038 .0049522563184663 .0032223080762648 1 "NESTLE 'N'" 20039 .0007054674013925 -.0031941157300339 1 "NESTLE 'N'" 20040 .0084270161618801 .0097205484460905 1 "NESTLE 'N'" 20041 -.0006995453240855 -.0043750080276395 1 "NESTLE 'N'" 20044 -.0007000350303376 .0013159696020317 1 "NESTLE 'N'" 20045 .002797204621061 .005082808928689 1 "NESTLE 'N'" 20046 .0013956736389748 .0012229855957888 1 "NESTLE 'N'" 20047 .0006971070341557 .0007143866871528 1 "NESTLE 'N'" 20048 .0048661896511729 .010028589087032 1 "NESTLE 'N'" 20051 -.0048661896511728 -.002430116097126 1 "NESTLE 'N'" 20052 -.0020927806731306 -.0017424215443522 1 "NESTLE 'N'" 20053 .003485538558434 .0017898895931208 1 "NESTLE 'N'" 20054 .0041666726948461 .0077204751838029 1 "NESTLE 'N'" 20055 .0055286941103169 .0023315606463968 1 "NESTLE 'N'" 20058 .0048126596844157 -.0004678454708696 1 "NESTLE 'N'" 20059 0 -.0008334819572092 1 "NESTLE 'N'" 20060 -.0082645098498935 .0032566931044356 1 "NESTLE 'N'" 20061 -.0027700848738156 -.0054903908671599 1 "NESTLE 'N'" 20062 .0055325175697257 .0103301225956557 1 "NESTLE 'N'" 20065 -.0020711087831363 -.0034369768895232 1 "NESTLE 'N'" 20066 -.0097222988033119 -.0142439346850057 1 "NESTLE 'N'" 20067 -.002095704574219 -.003381989498622 1 "NESTLE 'N'" 20068 .0027932979056127 .0042025211674284 1 "NESTLE 'N'" 20069 -.0161690693067518 -.0182102004549737 1 "NESTLE 'N'" 20072 -.0207669475251988 -.0207331640419422 1 "NESTLE 'N'" 20073 .0143680632669202 .0094026549558896 1 "NESTLE 'N'" 20074 -.0014275519911853 -.0021911099819013 1 "NESTLE 'N'" 20075 .0198026272961797 .0266731348691425 1 "NESTLE 'N'" 20076 .0118344576470028 -.0040990977023607 1 "NESTLE 'N'" 20079 .0055210630237505 .0063532678724954 1 "NESTLE 'N'" 20080 .0048060511320992 -.0013048932016547 1 "NESTLE 'N'" 20081 0 0 1 "NESTLE 'N'" 20082 0 0 1 "NESTLE 'N'" 20083 0 0 1 "NESTLE 'N'" 20086 .0034188067487855 .0014266554333746 1 "NESTLE 'N'" 20087 -.0041039729283821 -.0056810261837974 1 "NESTLE 'N'" 20088 0 0 1 "NESTLE 'N'" 20089 0 0 1 "NESTLE 'N'" 20090 0 0 1 "NESTLE 'N'" 20093 -.0158897989146163 -.0049681447467889 1 "NESTLE 'N'" 20094 -.0069881486339283 -.0072283302960199 1 "NESTLE 'N'" 20095 .0035001785822096 .0029659155483526 1 "NESTLE 'N'" 20096 .0180060266387539 .0264819372250905 1 "NESTLE 'N'" 20097 -.0027491426249218 -.0037258769827564 1 "NESTLE 'N'" 20100 .0082248578808848 .0051778257242762 1 "NESTLE 'N'" 20101 .0155776939418696 .0143896270926776 1 "NESTLE 'N'" 20102 -.0033658732551051 -.009460231137353 1 "NESTLE 'N'" 20103 -.0640441502144893 -.0907034904784465 1 "NESTLE 'N'" 20104 -.0707403150112229 -.0614934628682389 1 "NESTLE 'N'" 20107 .0348784406194071 .0315481139923933 1 "NESTLE 'N'" 20108 -.0029850768434532 .0031986938601383 1 "NESTLE 'N'" 20109 -.0135442251077573 -.0210479462713971 1 "NESTLE 'N'" 20110 .0045351551653911 -.0011331814059027 1 "NESTLE 'N'" 20111 .0311829274366881 .020009776168187 1 "NESTLE 'N'" 20114 .011628037995119 .0164413967293751 1 "NESTLE 'N'" 20115 .0179023757210654 .0127396513307439 1 "NESTLE 'N'" 20116 -.0135764857739428 -.0109212500589735 1 "NESTLE 'N'" 20117 .0185322481289277 .0147839096884779 1 "NESTLE 'N'" 20118 -.0049557623549848 -.0059701243940975 1 "NESTLE 'N'" 20121 .0091840984645059 .0052419693099635 1 "NESTLE 'N'" 20122 -.0021119332031434 .0027166122695206 1 "NESTLE 'N'" 20123 .0105153439995229 .0183014034612103 1 "NESTLE 'N'" 20124 -.0062959284568148 -.0074531493716451 1 "NESTLE 'N'" 20125 -.0028109646056503 .0050979809003865 1 "NESTLE 'N'" 20128 .0014064699927518 .0051277309449562 1 "NESTLE 'N'" 20129 .0042075798400151 -.0013586391588064 1 "NESTLE 'N'" 20130 -.0077274708377946 -.0049610002330397 1 "NESTLE 'N'" 20131 -.0042402890388856 .0038711324703775 1 "NESTLE 'N'" 20132 -.0042583456825771 .0047442568600064 1 "NESTLE 'N'" 20135 .0035498794822038 .0069923871124588 1 "NESTLE 'N'" 20136 .0091711401191071 .0040250860160916 1 "NESTLE 'N'" 20137 -.001405481608735 .006026730435302 1 "NESTLE 'N'" 20138 .0125787822068602 .0112391012049387 1 "NESTLE 'N'" 20139 -.0013898542890542 -.0009003870248889 1 "NESTLE 'N'" 20142 .0165521020287317 .0095714966875206 1 "NESTLE 'N'" 20143 .0040955688647372 .0007705027020317 1 "NESTLE 'N'" 20144 .0013614705983209 -.0007782998383663 1 "NESTLE 'N'" 20145 .0148551009909241 .0079735887537756 1 "NESTLE 'N'" 20146 -.0026845653706689 -.0038706825665697 1 "NESTLE 'N'" 20149 .0053619431413854 .0045555694599729 1 "NESTLE 'N'" 20150 -.0026773777707164 -.0112169887786511 1 "NESTLE 'N'" 20151 .0106667678041954 .0042145959401385 1 "NESTLE 'N'" 20152 .0059504307806307 .0046707542020157 1 "NESTLE 'N'" 20153 .0039473735466298 .0050158457828439 1 "NESTLE 'N'" 20156 -.0032883949395866 -.0036575496823017 1 "NESTLE 'N'" 20157 -.0079365495957364 -.0025643891757088 1 "NESTLE 'N'" 20158 0 .0091032369507206 1 "NESTLE 'N'" 20159 -.0026595760357588 .0014901758706779 1 "NESTLE 'N'" 20160 .0039867162438214 .0039626159120275 1 "NESTLE 'N'" 20163 .0066094093876738 .008814231945664 1 "NESTLE 'N'" 20164 -.0026385239581812 -.0041843039766992 1 "NESTLE 'N'" 20165 .0065833022491974 .0062564042653923 1 "NESTLE 'N'" 20166 .004582659411092 .0077741675779324 1 "NESTLE 'N'" 20167 -.0006533812712026 .0072428442577012 1 end format %td date
Code error
My Code : eventstudy2 security_id date using security_returns_file, returns(security_returns) model(FM) marketfile(security_returns_file) marketreturns(market_return) replace
Generating dateline ...
...succeeded
Preparation of event list ...
...succeeded
Preparation of security return data...
variables date __000005 do not uniquely identify observations in the using data
r(459);
Comment